package threadpool;

/**
 * @description:
 * @author: walt-zhong
 * @createDate: 2021/8/11
 */
public class TestMain {
    private static Object lock = new Object();
    public static void main(String[] args) {
        synchronized (lock){
            MyThreadPoolExector.getInstance().execute("zxj", new Runnable() {
                @Override
                public void run() {
                    System.out.println("zxj is running");
                }
            });

            MyThreadPoolExector.getInstance().execute("zxj1", new Runnable() {
                @Override
                public void run() {
                    System.out.println("zxj1 is running");
                }
            });

            MyThreadPoolExector.getInstance().execute("zxj2", new Runnable() {
                @Override
                public void run() {
                    System.out.println("zxj2 is running");
                }
            });
        }

        MyThreadPoolExector instance = MyThreadPoolExector.getInstance();
        System.out.println("active count: "+instance.getExecutor().getActiveCount());

    }
}
